import { pubRequire } from '@utils/appletPublic'
// 获取学院列表
export function getCollegeList(callBack, errBack) {
  return pubRequire('get', '/colleges', {}, callBack, errBack)
}
// 查询橱窗体验课章节列表
export function getChapterCourseList(params, callBack, errBack) {
  return pubRequire(
    'get',
    '/display-trials-courses/chapters',
    params,
    callBack,
    errBack
  )
}
// 查询橱窗章节详情
export function getChaptersDetail(params, callBack, errBack) {
  return pubRequire(
    'get',
    `/display-trials-courses/${params.courseId}/chapters/${params.chapterId}`,
    {},
    callBack,
    errBack
  )
}
// 学院详情获取根据id
export function getCollegeDetail(params, callBack, errBack) {
  return pubRequire('get', `/colleges/${params}`, {}, callBack, errBack)
}
// 修改橱窗章节详情
export function updateChaptersDetail(params, callBack, errBack) {
  return pubRequire(
    'put',
    `/display-trials-courses/${params.courseId}/chapters/${params.chapterId}`,
    params.updateList,
    callBack,
    errBack
  )
}
// 修改橱窗章节详情
export function updateCollegeDetail(params, callBack, errBack) {
  return pubRequire(
    'put',
    `/colleges/${params.collegeId}`,
    params.updateList,
    callBack,
    errBack
  )
}
//批量图片上传
export function uploadImg(formData, callbBack, errBack) {
  return pubRequire(
    'post',
    `/system/images/upload`,
    formData,
    callbBack,
    errBack
  )
}
